package com.cvte.shop.entity;


import java.io.Serializable;

import com.cvte.shop.constants.UniversalResultFieldsConstants;
import com.cvte.shop.entity.dto.MethodDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.*;

import static org.apache.ibatis.type.JdbcType.*;

import tk.mybatis.mapper.annotation.ColumnType;
import com.cvte.csb.validator.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;


/**
 * 方法配置表
 *
 * @author inv
 * @since 2020-08-04
 */
@Table(name = "UNIVERSAL_METHOD_CONFIG")
@ApiModel(description = "方法配置表")
@Data
@EqualsAndHashCode
public class UniversalMethodConfig extends BaseEntity {

    private static final long serialVersionUID = 1L;

    public UniversalMethodConfig(){

    }

    public UniversalMethodConfig(MethodDTO methodDTO){
        this.methodName = methodDTO.getMethodName();
        this.requestType = methodDTO.getRequestType();
        this.tableId = methodDTO.getTableId();
        this.viewId = UniversalResultFieldsConstants.DEAULT_VIEW_ID;
    }

    public UniversalMethodConfig(String methodId, String methodName, String requestType, String tableId, String viewId) {
        this.methodId = methodId;
        this.methodName = methodName;
        this.requestType = requestType;
        this.tableId = tableId;
        this.viewId = viewId;
    }

    /**
     * 方法的主键
     */
    @Column(name = "METHOD_ID")
    @ApiModelProperty(value = "方法的主键")
    private String methodId;
    /**
     * 方法名
     */
    @Column(name = "METHOD_NAME")
    @ApiModelProperty(value = "方法名")
    private String methodName;
    /**
     * 请求方式
     */
    @Column(name = "REQUEST_TYPE")
    @ApiModelProperty(value = "请求方式")
    private String requestType;
    /**
     * 表的id
     */
    @Column(name = "TABLE_ID")
    @ApiModelProperty(value = "表的id")
    private String tableId;

    /**
     * 视图的id
     */
    @Column(name = "VIEW_ID")
    @ApiModelProperty(value = "视图的id")
    private String viewId;

}
